<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Program functions &mdash; GSLab Make 2.0.0 documentation</title>
      <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../_static/graphviz.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/sphinx_highlight.js"></script>
    <script src="../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="execute_command" href="api/run_program/gslab_make.run_program.execute_command.html" />
    <link rel="prev" title="write_source_logs" href="api/write_source_logs/gslab_make.write_source_logs.write_source_logs.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../index.html" class="icon icon-home">
            GSLab Make
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="specifying_paths.html">Specifying paths</a></li>
<li class="toctree-l1"><a class="reference internal" href="general_logging.html">General logging functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="sourcing.html">Sourcing functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="source_logging.html">Source logging functions</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Program functions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#default-settings">Default settings</a></li>
<li class="toctree-l2"><a class="reference internal" href="#supported-applications">Supported applications</a><ul>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.execute_command.html">execute_command</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_jupyter.html">run_jupyter</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_latex.html">run_latex</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_lyx.html">run_lyx</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_mathematica.html">run_mathematica</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_matlab.html">run_matlab</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_module.html">run_module</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_perl.html">run_perl</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_python.html">run_python</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_r.html">run_r</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_sas.html">run_sas</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_stat_transfer.html">run_stat_transfer</a></li>
<li class="toctree-l3"><a class="reference internal" href="api/run_program/gslab_make.run_program.run_stata.html">run_stata</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="utility.html">Utility functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="repository.html">Repository functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="directory.html">Directory functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="filling.html">Filling functions</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">GSLab Make</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Program functions</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../_sources/pages/program.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="program-functions">
<h1>Program functions<a class="headerlink" href="#program-functions" title="Permalink to this heading"></a></h1>
<p>The <code class="xref py py-mod docutils literal notranslate"><span class="pre">gslab_make</span></code> library provides functions to run code scripts (i.e., <em>programs</em>) for certain applications. These program functions are implemented as Python wrappers around system commands.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>To use the program function for a specific application, please make sure that you have set up command line usage for the application.</p>
</div>
<section id="default-settings">
<h2>Default settings<a class="headerlink" href="#default-settings" title="Permalink to this heading"></a></h2>
<p>Unless specified otherwise, the program functions will assume the following default executables when executing your program.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">default_executables</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;posix&#39;</span><span class="p">:</span>
        <span class="p">{</span><span class="s1">&#39;lyx&#39;</span>       <span class="p">:</span> <span class="s1">&#39;lyx&#39;</span><span class="p">,</span>
         <span class="s1">&#39;perl&#39;</span>      <span class="p">:</span> <span class="s1">&#39;perl&#39;</span><span class="p">,</span>
         <span class="s1">&#39;python&#39;</span>    <span class="p">:</span> <span class="s1">&#39;python&#39;</span><span class="p">,</span>
         <span class="s1">&#39;math&#39;</span>      <span class="p">:</span> <span class="s1">&#39;math&#39;</span><span class="p">,</span>
         <span class="s1">&#39;matlab&#39;</span>    <span class="p">:</span> <span class="s1">&#39;matlab&#39;</span><span class="p">,</span>
         <span class="s1">&#39;r&#39;</span>         <span class="p">:</span> <span class="s1">&#39;Rscript&#39;</span><span class="p">,</span>
         <span class="s1">&#39;sas&#39;</span>       <span class="p">:</span> <span class="s1">&#39;sas&#39;</span><span class="p">,</span>
         <span class="s1">&#39;st&#39;</span>        <span class="p">:</span> <span class="s1">&#39;st&#39;</span><span class="p">,</span>
         <span class="s1">&#39;stata&#39;</span>     <span class="p">:</span> <span class="s1">&#39;stata-mp&#39;</span><span class="p">},</span>
    <span class="s1">&#39;nt&#39;</span><span class="p">:</span>
        <span class="p">{</span><span class="s1">&#39;lyx&#39;</span>       <span class="p">:</span> <span class="s1">&#39;lyx&#39;</span><span class="p">,</span>
         <span class="s1">&#39;perl&#39;</span>      <span class="p">:</span> <span class="s1">&#39;perl&#39;</span><span class="p">,</span>
         <span class="s1">&#39;python&#39;</span>    <span class="p">:</span> <span class="s1">&#39;python&#39;</span><span class="p">,</span>
         <span class="s1">&#39;matlab&#39;</span>    <span class="p">:</span> <span class="s1">&#39;matlab&#39;</span><span class="p">,</span>
         <span class="s1">&#39;math&#39;</span>      <span class="p">:</span> <span class="s1">&#39;math&#39;</span><span class="p">,</span>
         <span class="s1">&#39;r&#39;</span>         <span class="p">:</span> <span class="s1">&#39;Rscript&#39;</span><span class="p">,</span>
         <span class="s1">&#39;sas&#39;</span>       <span class="p">:</span> <span class="s1">&#39;sas&#39;</span><span class="p">,</span>
         <span class="s1">&#39;st&#39;</span>        <span class="p">:</span> <span class="s1">&#39;st&#39;</span><span class="p">,</span>
         <span class="s1">&#39;stata&#39;</span>     <span class="p">:</span> <span class="s1">&#39;StataMP-64&#39;</span><span class="p">}</span>
</pre></div>
</div>
<p>To change the default executables, we recommend importing in a user configuration file using the <a class="reference internal" href="api/make_utility/gslab_make.make_utility.update_executables.html#gslab_make.make_utility.update_executables" title="gslab_make.make_utility.update_executables"><code class="xref py py-func docutils literal notranslate"><span class="pre">update_executables()</span></code></a>. We do not recommend passing in an executable name into the <code class="docutils literal notranslate"><span class="pre">executable</span></code> argument of your program function as this will be global for any user.</p>
<p>The program functions will assume the following default options when executing system command.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">default_options</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;posix&#39;</span><span class="p">:</span>
        <span class="p">{</span><span class="s1">&#39;lyx&#39;</span>       <span class="p">:</span> <span class="s1">&#39;-e pdf2&#39;</span><span class="p">,</span>
         <span class="s1">&#39;perl&#39;</span>      <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;python&#39;</span>    <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;math&#39;</span>      <span class="p">:</span> <span class="s1">&#39;-noprompt&#39;</span><span class="p">,</span>
         <span class="s1">&#39;matlab&#39;</span>    <span class="p">:</span> <span class="s1">&#39;-nosplash -nodesktop&#39;</span><span class="p">,</span>
         <span class="s1">&#39;r&#39;</span>         <span class="p">:</span> <span class="s1">&#39;--no-save&#39;</span><span class="p">,</span>
         <span class="s1">&#39;st&#39;</span>        <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;sas&#39;</span>       <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;stata&#39;</span>     <span class="p">:</span> <span class="s1">&#39;-e&#39;</span><span class="p">},</span>
    <span class="s1">&#39;nt&#39;</span><span class="p">:</span>
        <span class="p">{</span><span class="s1">&#39;lyx&#39;</span>       <span class="p">:</span> <span class="s1">&#39;-e pdf2&#39;</span><span class="p">,</span>
         <span class="s1">&#39;perl&#39;</span>      <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;python&#39;</span>    <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;matlab&#39;</span>    <span class="p">:</span> <span class="s1">&#39;-nosplash -minimize -wait&#39;</span><span class="p">,</span>
         <span class="s1">&#39;math&#39;</span>      <span class="p">:</span> <span class="s1">&#39;-noprompt&#39;</span><span class="p">,</span>
         <span class="s1">&#39;r&#39;</span>         <span class="p">:</span> <span class="s1">&#39;--no-save&#39;</span><span class="p">,</span>
         <span class="s1">&#39;st&#39;</span>        <span class="p">:</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
         <span class="s1">&#39;sas&#39;</span>       <span class="p">:</span> <span class="s1">&#39;-nosplash&#39;</span><span class="p">,</span>
         <span class="s1">&#39;stata&#39;</span>     <span class="p">:</span> <span class="s1">&#39;/e&#39;</span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>To change the default options, you may pass your desired options into the <code class="docutils literal notranslate"><span class="pre">options</span></code> argument of your program function.</p>
</section>
<section id="supported-applications">
<h2>Supported applications<a class="headerlink" href="#supported-applications" title="Permalink to this heading"></a></h2>
<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_stata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.do</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>When a do-file contains a space in its name, different version of Stata save the
corresponding log file with different names. Some versions of Stata truncate the
name to everything before the first space of the do-file name.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_stata</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.do&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_matlab</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.m</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_matlab</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.m&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_perl</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.pl</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Arguments for system command. Defaults to no arguments.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_perl</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.pl&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_python</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.py</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Arguments for system command. Defaults to no arguments.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_python</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.py&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_jupyter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timeout</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kernel_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs notebook <code class="docutils literal notranslate"><span class="pre">program</span></code> using Python API, with notebook specified
in the form of <code class="docutils literal notranslate"><span class="pre">notebook.ipynb</span></code>.
Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>timeout</strong> (<em>int</em><em>, </em><em>optional</em>) – Time to wait (in seconds) to finish executing a cell before raising exception.
Defaults to no timeout.</p></li>
<li><p><strong>kernel_name</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of kernel to use for execution
(e.g., <code class="docutils literal notranslate"><span class="pre">python2</span></code> for standard Python 2 kernel, <code class="docutils literal notranslate"><span class="pre">python3</span></code> for standard Python 3 kernel).
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., kernel specified in notebook).</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_jupyter</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;notebook.ipynb&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_mathematica</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.m</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_mathematica</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.m&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_stat_transfer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.stc</span></code> or <code class="docutils literal notranslate"><span class="pre">script.stcmd</span></code>.
Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_stat_transfer</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.stc&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_lyx</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">doctype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Compiles document <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with document specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.lyx</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.
PDF outputs are written in directory <code class="docutils literal notranslate"><span class="pre">output_dir</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
<li><p><strong>doctype</strong> (<em>str</em><em>, </em><em>optional</em>) – Type of LyX document. Takes either <code class="docutils literal notranslate"><span class="pre">'handout'</span></code> and <code class="docutils literal notranslate"><span class="pre">'comments'</span></code>.
All other strings will default to standard document type.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., standard document type).</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p></li>
<li><p><strong>output_dir</strong> (<em>str</em>) – Directory to write PDFs.</p></li>
</ul>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_lyx</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.lyx&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_latex</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Compiles document <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with document specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.tex</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.
PDF outputs are written in directory <code class="docutils literal notranslate"><span class="pre">output_dir</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p></li>
<li><p><strong>output_dir</strong> (<em>str</em>) – Directory to write PDFs.</p></li>
</ul>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This function creates and removes a directory named <code class="docutils literal notranslate"><span class="pre">latex_auxiliary_dir</span></code>.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_latex</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.tex&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_r</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.R</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_r</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.R&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_sas</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">program</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">lst</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <code class="docutils literal notranslate"><span class="pre">program</span></code> using system command, with script specified
in the form of <code class="docutils literal notranslate"><span class="pre">script.sas</span></code>. Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>program</strong> (<em>str</em>) – Path of script to run.</p></li>
<li><p><strong>lst</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program lst. Program lst is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of program log. Program log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
<li><p><strong>executable</strong> (<em>str</em><em>, </em><em>optional</em>) – Executable to use for system command.
Defaults to executable specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>option</strong> (<em>str</em><em>, </em><em>optional</em>) – Options for system command. Defaults to options specified in <a class="reference internal" href="#default-settings"><span class="std std-ref">default settings</span></a>.</p></li>
<li><p><strong>args</strong> (<em>str</em><em>, </em><em>optional</em>) – Not applicable.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_sas</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="n">program</span> <span class="o">=</span> <span class="s1">&#39;script.sas&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">execute_command</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">paths</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">command</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs system command <cite>command</cite> with shell execution boolean <code class="docutils literal notranslate"><span class="pre">shell</span></code>.
Outputs are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code> and written to system command log file <code class="docutils literal notranslate"><span class="pre">log</span></code>.
Status messages are appended to file <code class="docutils literal notranslate"><span class="pre">makelog</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>paths</strong> (<em>dict</em>) – Dictionary of paths. Dictionary should contain values for all keys listed below.</p></li>
<li><p><strong>command</strong> (<em>str</em>) – System command to run.</p></li>
<li><p><strong>shell</strong> (<cite>bool</cite>, optional) – <p>See <a class="reference external" href="https://docs.python.org/3/library/subprocess.html#frequently-used-arguments">here</a>.
Defaults to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</p></li>
<li><p><strong>log</strong> (<em>str</em><em>, </em><em>optional</em>) – Path of system command log. System command log is only written if specified.
Defaults to <code class="docutils literal notranslate"><span class="pre">''</span></code> (i.e., not written).</p></li>
</ul>
</dd>
<dt class="field-even">Path Keys<span class="colon">:</span></dt>
<dd class="field-even"><p><strong>makelog</strong> (<em>str</em>) – Path of makelog.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>We recommend leaving all other parameters to their defaults.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to check if OS is supported. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<p>The following code executes the <code class="docutils literal notranslate"><span class="pre">ls</span></code> command,
writes outputs to system command log file <code class="docutils literal notranslate"><span class="pre">'file'</span></code>,
and appends outputs and/or status messages to <code class="docutils literal notranslate"><span class="pre">paths['makelog']</span></code>.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">execute_command</span><span class="p">(</span><span class="n">paths</span><span class="p">,</span> <span class="s1">&#39;ls&#39;</span><span class="p">,</span> <span class="n">log</span> <span class="o">=</span> <span class="s1">&#39;file&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py">
<span class="sig-name descname"><span class="pre">run_module</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">root</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">module</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">build_script</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'make.py'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">osname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">run_all</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span></dt>
<dd><p>Runs script <cite>build_script</cite> in module directory <cite>module</cite> relative to root of repository <cite>root</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>root</strong> (<em>str</em>) – Directory of root.</p></li>
<li><p><strong>module</strong> (<em>str</em>) – Name of module.</p></li>
<li><p><strong>build_script</strong> (<em>str</em>) – Name of build script. Defaults to <code class="docutils literal notranslate"><span class="pre">make.py</span></code>.</p></li>
<li><p><strong>osname</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of OS. Used to determine syntax of system command. Defaults to <code class="docutils literal notranslate"><span class="pre">os.name</span></code>.</p></li>
<li><p><strong>run_all</strong> (<em>bool</em>) – If being run from the root. Will make it so doesn’t recheck conda status.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
<p class="rubric">Example</p>
<p>The following code runs the script <code class="docutils literal notranslate"><span class="pre">root/module/make.py</span></code>.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">run_module</span><span class="p">(</span><span class="n">root</span> <span class="o">=</span> <span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="n">module</span> <span class="o">=</span> <span class="s1">&#39;module&#39;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

<div class="toctree-wrapper compound">
</div>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="api/write_source_logs/gslab_make.write_source_logs.write_source_logs.html" class="btn btn-neutral float-left" title="write_source_logs" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="api/run_program/gslab_make.run_program.execute_command.html" class="btn btn-neutral float-right" title="execute_command" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2023, Matthew Gentzkow.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>